﻿using System;
using System.Data;
using System.Collections.Generic;
using System.Text;

using XianShang.Data;
using XianShang.Common;
using XianShang.Entity;
using XianShang.Data.DataProvider;

namespace XianShang.Data.DataProvider
{
    /// <summary>
    /// IBonPay調用接口實現類
    /// </summary>
    public class IBonPay
    {
       /// <summary>
        /// 在IBONPAY主表中插入一條新數據并返回自增ID值
        /// </summary>
        /// <param name="rbInfo"></param>
        /// <returns></returns>
        public static long AddNewIBonPay(IBonPayInfo ibonInfo)
        {
            return DatabaseProvider.GetInstance().AddNewIBonPay(ibonInfo);
        }
        /// <summary>
        /// 新增一條數據到（IBONPAY子表_帳號數量）CardAccount
        /// </summary>
        /// <param name="caInfo"></param>
        /// <returns></returns>
        public static int AddNewIBonPayAccount(IBonPayAccountInfo ibonInfo)
        {
            return DatabaseProvider.GetInstance().AddNewIBonPayAccount(ibonInfo);
        }
        /// <summary>
        /// 根據訂單號更新支付狀態
        /// </summary>
        /// <param name="ibonInfo"></param>
        /// <returns></returns>
        public static int UpDateIBonPayPayNumAndPayStatus(IBonPayInfo ibonInfo)
        {
            return DatabaseProvider.GetInstance().UpDateIBonPayPayNumAndPayStatus(ibonInfo);
        }
        /// <summary>
        /// 根據相關條件查找IBONPAY繳費信息
        /// </summary>
        /// <param name="name"></param>
        /// <param name="tel"></param>
        /// <param name="gameAccount"></param>
        /// <param name="payOrder"></param>
        /// <returns></returns>
        public static DataSet GetIBonPayAndIBonPayAccountInfo(string name, string tel, string gameAccount, string payOrder)
        {
            return DatabaseProvider.GetInstance().GetIBonPayAndIBonPayAccountInfo(name,tel,gameAccount,payOrder);
        }
        /// <summary>
        /// 取得所有內容
        /// </summary>
        /// <returns></returns>
        public static DataTable GetAllIBonPayAndChildTableInfo()
        {
            return Utils.DrToDt(DatabaseProvider.GetInstance().GetAllIBonPayAndChildTableInfo());
        }
        /// <summary>
        /// 取得所有內容
        /// </summary>
        /// <returns></returns>
        public static DataTable GetAllIBonPayAndChildTableInfo(string area)
        {
            return Utils.DrToDt(DatabaseProvider.GetInstance().GetAllIBonPayAndChildTableInfo(area));
        }
        /// <summary>
        /// 取得所有內容
        /// </summary>
        /// <param name="pageSize">分頁大小</param>
        /// <param name="pageIndex">當前頁</param>
        /// <returns></returns>
        public static DataTable GetAllIBonPayAndChildTableInfo(int pageSize, int pageIndex)
        {
            return Utils.LoadDataRows(DatabaseProvider.GetInstance().GetAllIBonPayAndChildTableInfo(), pageSize, pageIndex);
        }
        /// <summary>
        /// 取得所有內容
        /// </summary>
        /// <param name="pageSize">分頁大小</param>
        /// <param name="pageIndex">當前頁</param>
        /// <returns></returns>
        public static DataTable GetAllIBonPayAndChildTableInfo(string area,int pageSize, int pageIndex)
        {
            return Utils.LoadDataRows(DatabaseProvider.GetInstance().GetAllIBonPayAndChildTableInfo(area), pageSize, pageIndex);
        }
        /// <summary>
        /// 根據實體參數進行查詢
        /// </summary>
        /// <param name="fr"></param>
        /// <param name="SearchType"></param>
        /// <returns></returns>
        public static DataTable GetIBonPayAndChildTableInfo(FullIBonPayInfo fip, int SearchType)
        {
            return Utils.DrToDt(DatabaseProvider.GetInstance().GetIBonPayAndChildTableInfo(fip, SearchType));
        }

        /// <summary>
        /// 根據 name,tel,bbsaccount,status,ip,pannum,time取得信息
        /// </summary>
        /// <param name="ma"></param>
        /// <param name="SearchType">查找方式（1精確0模糊）</param>        
        /// <returns></returns>
        public static DataTable GetIBonPayAndChildTableInfo(FullIBonPayInfo fip, int SearchType, int pageSize, int pageIndex)
        {
            return Utils.LoadDataRows(DatabaseProvider.GetInstance().GetIBonPayAndChildTableInfo(fip, SearchType), pageSize, pageIndex);
        }

        /// <summary>
        /// 更新Message ProcessIp Status ProcessTime四個字段
        /// </summary>
        /// <param name="cs"></param>
        /// <returns></returns>
        public static int UpIBonPayMessageProcessIpStatusProcessTime(FullIBonPayInfo fip)
        {
            return DatabaseProvider.GetInstance().UpIBonPayMessageProcessIpStatusProcessTime(fip);
        }
        /// <summary>
        /// 更新 ProcessIp Status ProcessTime三個字段
        /// </summary>
        /// <param name="cs"></param>
        /// <returns></returns>
        public static int UpIBonPayStatusProcessTimeProcessIpById(FullIBonPayInfo fip)
        {
            return DatabaseProvider.GetInstance().UpIBonPayStatusProcessTimeProcessIpById(fip);
        }
        /// <summary>
        /// 根據ID查找記錄
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public static DataTable GetIBonPayById(string id)
        {
            return DatabaseProvider.GetInstance().GetIBonPayById(id);
        }
        /// <summary>
        /// 根據ID刪除記錄
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>h
        public static int DelIBonPayById(string id)
        {
            return DatabaseProvider.GetInstance().DelIBonPayById(id);
        }

        /// <summary>
        /// 根據ID刪除記錄
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public static int DelIBonPayAccountByIBonPayId(string id)
        {
            return DatabaseProvider.GetInstance().DelIBonPayAccountByIBonPayId(id);
        }
    }
}
